<%--
  User: ljc,Date: 2025/9/24,Time: 10:59  
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    String username=request.getParameter("username");
    String password=request.getParameter("password");
    if("admin".contentEquals(username)&&"123".contentEquals(password)){
      //合法用户
//      request.getRequestDispatcher(request.getContextPath()+"login_suc.jsp").forward(request,response);
        session.setAttribute("login_user",username);//键值对，Map
//        session.setAttribute("login_role","admin,manager-gui,manager-status");
       response.sendRedirect(request.getContextPath()+"/login_suc.jsp");
    }else{
//      request.getReq=uestDispatcher("login_fail.jsp").forward(request,response);
        response.sendRedirect(request.getContextPath()+"/login_fail.jsp");
    }
%>
</body>
</html>
